package org.example.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @TableName take_sell
 */
@TableName(value = "take_sell")
@Data
public class Sell implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 委托的id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 持仓id
     */
    private Integer positionId;
    /**
     * 卖出价格
     */
    private BigDecimal sellPrice;
    /**
     * 卖出时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;
    /**
     * 状态:0未卖出 1已撤销 2已卖出
     */
    private Integer issell;
    /**
     * 委托人id
     */
    private Integer userId;
    /**
     * 股票数量
     */
    private Integer num;

    private Integer stockId;
    private BigDecimal averagePrice;
    @TableField(exist = false)
    private String stockCode;
    @TableField(exist = false)
    private String stockName;
    @TableField(exist = false)
    private String volumeCode;
    @TableField(exist = false)
    private BigDecimal volumePrice;
    @TableField(exist = false)
    private String nickName;

    @TableField(exist = false)
    private Integer buyNum;
    @TableField(exist = false)
    private Integer newDate;
    //    购买时自定义价格
    @TableField(exist = false)
    private BigDecimal buyPrice;

}